<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="10" :lg="11" :md="12" :sm="24">
            <a-form-item :label="$t('时间')">
              <a-date-picker
                :show-time="{ defaultValue: moment('00:00:00', 'HH:mm:ss') }"
                valueFormat="YYYY-MM-DD HH:mm:ss"
                :placeholder="$t('请选择开始时间')"
                class="query-group-cust"
                v-model="queryParam.bTime"
              ></a-date-picker>
              <span class="query-group-split-cust"></span>
              <a-date-picker
                :show-time="{ defaultValue: moment('23:59:59', 'HH:mm:ss') }"
                valueFormat="YYYY-MM-DD HH:mm:ss"
                :placeholder="$t('请选择结束时间')"
                class="query-group-cust"
                v-model="queryParam.eTime"
              ></a-date-picker>
            </a-form-item>
          </a-col>
          <a-col :xl="5" :lg="6" :md="7" :sm="24">
            <a-form-item :label="$t('商品形态')">
              <a-select v-model="queryParam.goodsForm">
                <a-select-option :value="item.value" :key="index" v-for="(item, index) in formList">{{
                  item.title
                }}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
            <a-col :xl="5" :lg="6" :md="7" :sm="24">
              <a-form-item :label="$t('商品分类')">
                <a-tree-select
                  v-model="queryParam.goodsKind"
                  style="width: 100%"
                  :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
                  :tree-data="treeData"
                  :search-placeholder="$t('请选择')"
                />
              </a-form-item>
            </a-col>
            <a-col :xl="5" :lg="6" :md="7" :sm="24">
              <a-form-item :label="$t('业务类型')">
                <a-select v-model="queryParam.orderType">
                  <a-select-option :value="item.value" :key="index" v-for="(item, index) in sumList">{{
                    item.title
                  }}</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
            <a-col :xl="5" :lg="6" :md="7" :sm="24">
              <a-form-item :label="$t('商品')">
                <a-input :placeholder="$t('请输入商品编码/名称/条码')" v-model="queryParam.goodsInfo" />
              </a-form-item>
            </a-col>
            <a-col :xl="5" :lg="6" :md="7" :sm="24">
              <a-form-item :label="$t('业务渠道')">
                <a-select v-model="queryParam.deviceType">
                  <a-select-option :value="item.value" :key="index" v-for="(item, index) in deviceinfoList">{{
                    item.title
                  }}</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
            <a-col :xl="5" :lg="6" :md="7" :sm="24">
              <a-form-item :label="$t('汇总方式')">
                <a-select v-model="queryParam.sumMethod">
                  <a-select-option value="1">{{ $t('商品形态') }}</a-select-option>
                  <a-select-option value="2">{{ $t('商品分类') }}</a-select-option>
                  <a-select-option value="3">{{ $t('供应商') }}</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
            <a-col :xl="5" :lg="6" :md="7" :sm="24" v-if="!tenantid">
              <a-form-item :label="$t('门店')">
                <a-select v-model="queryParam.shopCode">
                  <a-select-option v-for="(item, i) in shops" :key="i" :value="item.value"
                    >{{ item.title }}<span v-if="item.value != ''">（{{ item.value }}）</span></a-select-option
                  >
                </a-select>
              </a-form-item>
            </a-col>
          </template>
          <a-col :xl="8" :lg="9" :md="10" :sm="24">
            <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">{{ $t('查询') }}</a-button>
              <a-dropdown>
                <a-menu slot="overlay" @click="handleDateClick">
                  <a-menu-item key="1"> {{ $t('今日') }} </a-menu-item>
                  <a-menu-item key="2"> {{ $t('近三天') }} </a-menu-item>
                  <a-menu-item key="3"> {{ $t('近七天') }} </a-menu-item>
                  <a-menu-item key="4"> {{ $t('近一月') }} </a-menu-item>
                  <a-menu-item key="5"> {{ $t('近三月') }} </a-menu-item>
                  <a-menu-item key="6"> {{ $t('近半年') }} </a-menu-item>
                  <a-menu-item key="7"> {{ $t('本年') }} </a-menu-item>
                </a-menu>
                <a-button type="primary" style="margin-left: 8px">
                  {{ $t('快捷查询') }} <a-icon type="down"
                /></a-button>
              </a-dropdown>
              <a-button type="primary" @click="searchReset" style="margin-left: 8px">{{ $t('重置') }}</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? $t('收起') : $t('展开') }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
              </a>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->

    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button
        type="primary"
        :loading="exloading"
        @click="handleExportXls($t('商品销售兑换报表'))"
        v-has="'GoodsSaleConvertReportController:export'"
        >{{ $t('导出') }}</a-button
      >
      <a-button type="primary" v-print="'#printme'" v-has="'GoodsSaleConvertReportController:print'">{{
        $t('打印')
      }}</a-button>
    </div>
    <!-- table区域-begin -->
    <div id="printme">
      <a-table
        class="printable-table"
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :scroll="{ x: 1900, y: tableHeight }"
        :columns="columns"
        :dataSource="dataSources"
        :pagination="false"
        :loading="loading"
        :customHeaderRow="customHeaderRow"
        :customRow="customRow"
        @change="handleTableChange"
      >
        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px; font-style: italic">{{ $t('无图片') }}</span>
          <img
            v-else
            :src="getImgView(text)"
            height="25px"
            alt
            style="max-width: 80px; font-size: 12px; font-style: italic"
          />
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px; font-style: italic">{{ $t('无文件') }}</span>
          <a-button v-else :ghost="true" type="primary" icon="download" size="small" @click="downloadFile(text)">{{
            $t('下载')
          }}</a-button>
        </template>
        <span slot="action" slot-scope="text, record">
          <a @click="handleDetail(record)">{{ $t('详情') }}</a>
        </span>
        <!-- 自定义 goodsForm 列渲染 -->
        <template slot="goodsFormCell" slot-scope="text, record">
          <template v-if="record.showGroupColumn">
            {{ text }}
          </template>
        </template>
      </a-table>
    </div>
  </a-card>
</template>

<script>
import Vue from 'vue'
import moment from 'moment'
import '@/assets/less/TableExpand.less'
import { getAction } from '@/api/manage'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { initDictOptions, filterMultiDictText } from '@/components/dict/JDictSelectUtil'
export default {
  name: 'SiteCollectionReport',
  mixins: [JeecgListMixin],
  components: {},
  data() {
    return {
      moment,
      description: '商品销售兑换报表页面',
      tenantid: Vue.ls.get('TENANT_ID'),
      // 表头
      groupColumn: 'goodsForm',
      columns: [
        {
          title: this.$t('项目'),
          align: 'center',
          dataIndex: this.groupColumn,
          width: 120,
          scopedSlots: { customRender: 'goodsFormCell' },
          customRender: this.groupColumnRender,
        },
        {
          title: this.$t('商品名称'),
          align: 'center',
          dataIndex: 'goodsName',
          width: 260,
          customRender: (t, r) => {
            let str = ''
            if (r.goodsCode) {
              str += r.goodsCode + '('
            }
            str += r.goodsName
            if (r.goodsCode) {
              str += ')'
            }
            return str
          },
          customCell:()=>{
            return {
              style:{
                'textAlign': 'left'
              }
            }
          }
        },
        {
          title: this.$t('销售'),
          align: 'center',
          children: [
            {
              title: this.$t('数量'),
              align: 'center',
              dataIndex: 'saleNum',
              width: 80,
              customCell: (r, i) => {
                return {
                  style: {
                    textAlign: 'right',
                  },
                }
              },
            },
            {
              title: this.$t('成本'),
              align: 'center',
              dataIndex: 'saleCost',
              width: 100,
              customRender: (t, r) => {
                if (!t) {
                  t = 0
                }
                return t.toFixed(2)
              },
              customCell: (r, i) => {
                return {
                  style: {
                    textAlign: 'right',
                  },
                }
              },
            },
            {
              title: this.$t('金额'),
              align: 'center',
              dataIndex: 'sale',
              width: 100,
              customRender: (t, r) => {
                if (!t) {
                  t = 0
                }
                return t.toFixed(2)
              },
              customCell: (r, i) => {
                return {
                  style: {
                    textAlign: 'right',
                  },
                }
              },
            },
            {
              title: this.$t('毛利润'),
              align: 'center',
              dataIndex: 'saleProfit',
              width: 100,
              customRender: (t, r) => {
                if (!t) {
                  t = 0
                }
                return t.toFixed(2)
              },
              customCell: (r, i) => {
                return {
                  style: {
                    textAlign: 'right',
                  },
                }
              },
            },
            {
              title: this.$t('毛利率'),
              align: 'center',
              dataIndex: 'saleProfitRate',
              width: 100,
              customRender: (t, r) => {
                if (!t) {
                  t = 0
                }
                return t.toFixed(2) + '%'
              },
              customCell: (r, i) => {
                return {
                  style: {
                    textAlign: 'right',
                  },
                }
              },
            },
          ],
        },
      ],
      url: {
        list: '/report/day/goodsSaleConvert/list',
        exportXlsUrl: '/report/day/goodsSaleConvert/export',
      },
      isNoPageTotal: true,
      formList: [],
      treeData: [],
      sumList: [],
      queryParam: {
        bTime: moment().format('YYYY-MM-DD 00:00:00'),
        eTime: moment().format('YYYY-MM-DD 23:59:59'),
        goodsForm: '',
        goodsKind: '',
        orderType: '',
        deviceType: '',
        shopCode: '',
        sumMethod: '1',
      },
      shops: [],
      deviceinfoList: [],
      isCustom: true,
      isHideData: false,
      thRows: 2,
      hideCond: 2,
      isOptArea: true
    }
  },
  created() {
    if (localStorage.getItem('operateCoin') == 1) {
      this.columns.splice(this.columns.length, 0, {
        title: this.$t('币兑换'),
        align: 'center',
        children: [
          {
            title: this.$t('数量'),
            align: 'center',
            dataIndex: 'coinNum',
            width: 80,
            customCell: (r, i) => {
              return {
                style: {
                  textAlign: 'right',
                },
              }
            },
          },
          {
            title: this.$t('总币值'),
            align: 'center',
            dataIndex: 'coin',
            width: 100,
            customCell: (r, i) => {
              return {
                style: {
                  textAlign: 'right',
                },
              }
            },
          },
        ],
      })
    }
    if (localStorage.getItem('operateLottery') == 1) {
      this.columns.splice(this.columns.length, 0, {
        title: this.$t('彩票兑换'),
        align: 'center',
        children: [
          {
            title: this.$t('数量'),
            align: 'center',
            dataIndex: 'lotteryNum',
            width: 80,
            customCell: (r, i) => {
              return {
                style: {
                  textAlign: 'right',
                },
              }
            },
          },
          {
            title: this.$t('总彩票'),
            align: 'center',
            dataIndex: 'lottery',
            width: 100,
            customCell: (r, i) => {
              return {
                style: {
                  textAlign: 'right',
                },
              }
            },
          },
        ],
      })
    }
    if (localStorage.getItem('operateCredit') == 1) {
      this.columns.splice(this.columns.length, 0, {
        title: this.$t('积分兑换'),
        align: 'center',
        children: [
          {
            title: this.$t('数量'),
            align: 'center',
            dataIndex: 'integralNum',
            width: 80,
            customCell: (r, i) => {
              return {
                style: {
                  textAlign: 'right',
                },
              }
            },
          },
          {
            title: this.$t('总积分'),
            align: 'center',
            dataIndex: 'integral',
            width: 100,
            customCell: (r, i) => {
              return {
                style: {
                  textAlign: 'right',
                },
              }
            },
          },
        ],
      })
    }
    if (localStorage.getItem('operateALottery') == 1) {
      this.columns.splice(this.columns.length, 0, {
        title: this.$t('A票兑换'),
        align: 'center',
        children: [
          {
            title: this.$t('数量'),
            align: 'center',
            dataIndex: 'alotteryNum',
            width: 80,
            customCell: (r, i) => {
              return {
                style: {
                  textAlign: 'right',
                },
              }
            },
          },
          {
            title: this.$t('总A票'),
            align: 'center',
            dataIndex: 'alottery',
            width: 110,
            customCell: (r, i) => {
              return {
                style: {
                  textAlign: 'right',
                },
              }
            },
          },
        ],
      })
    }
    if (localStorage.getItem('operateACoin') == 1) {
      this.columns.splice(this.columns.length, 0, {
        title: this.$t('A币兑换'),
        align: 'center',
        children: [
          {
            title: this.$t('数量'),
            align: 'center',
            dataIndex: 'pointNum',
            width: 80,
            customCell: (r, i) => {
              return {
                style: {
                  textAlign: 'right',
                },
              }
            },
          },
          {
            title: this.$t('总A币'),
            align: 'center',
            dataIndex: 'point',
            width: 100,
            customCell: (r, i) => {
              return {
                style: {
                  textAlign: 'right',
                },
              }
            },
          },
        ],
      })
    }
    this.select()
  },
  mounted() {
    let that = this
    document.onkeydown = function (e) {
      let key = window.event.keyCode
      if (key == 75 && event.ctrlKey) {
        window.event.preventDefault()
        that.isHideData = false
        that.queryParam.dataType = 0
        that.searchQuery()
      }
    }
  },
  computed: {
    // 处理数据，按 goodsForm 分组并添加合计行
    dataSources() {
      // 1. 排除合计行
      const filteredData = this.dataSource.filter((item) => item.goodsForm !== '合计')

      // 2. 按当前分组列分组
      const groups = {}
      filteredData.forEach((item) => {
        const groupKey = item[this.groupColumn]
        if (!groups[groupKey]) {
          groups[groupKey] = []
        }
        groups[groupKey].push(item)
      })

      // 3. 构建表格数据
      const result = []
      Object.keys(groups).forEach((groupValue) => {
        const items = groups[groupValue]
        let subTotal = {
          lotteryNum: 0,
          lottery: 0,
          pointNum: 0,
          point: 0,
          integralNum: 0,
          integral: 0,
          totalNum: 2,
          coinNum: 0,
          coin: 0,
          alotteryNum: 0,
          alottery: 0,
          saleNum: 0,
          sale: 0,
          saleCost: 0,
          saleProfit: 0,
        }

        // 添加分组数据
        items.forEach((item, index) => {
          // 累加小计
          subTotal.totalNum += item.totalNum
          subTotal.pointNum += item.pointNum
          subTotal.point += item.point
          subTotal.lotteryNum += item.lotteryNum
          subTotal.lottery += item.lottery
          subTotal.coinNum += item.coinNum
          subTotal.coin += item.coin
          subTotal.integralNum += item.integralNum
          subTotal.integral += item.integral
          subTotal.alotteryNum += item.alotteryNum
          subTotal.alottery += item.alottery
          subTotal.saleNum += item.saleNum
          subTotal.sale += item.sale
          subTotal.saleCost += item.saleCost
          subTotal.saleProfit += item.saleProfit

          result.push({
            ...item,
            showGroupColumn: index === 0, // 只有第一行显示goodsForm
            rowSpan: items.length + 1, // +1是为了包含小计行
            isSubTotal: false,
          })
        })

        // 计算小计行的利润率
        const subTotalProfitRate = subTotal.sale === 0 ? 0 : (subTotal.saleProfit / subTotal.sale) * 100

        // 添加小计行
        result.push({
          [this.groupColumn]: groupValue,
          goodsName: this.$t('小计'),
          goodsCode: '',
          lotteryNum: subTotal.lotteryNum,
          lottery: subTotal.lottery,
          pointNum: subTotal.pointNum,
          point: subTotal.point,
          integralNum: subTotal.integralNum,
          integral: subTotal.integral,
          totalNum: subTotal.totalNum,
          coinNum: subTotal.coinNum,
          coin: subTotal.coin,
          alotteryNum: subTotal.alotteryNum,
          alottery: subTotal.alottery,
          saleNum: subTotal.saleNum,
          sale: subTotal.sale,
          saleCost: subTotal.saleCost,
          saleProfit: subTotal.saleProfit,
          saleProfitRate: subTotalProfitRate,
          showGroupColumn: false,
          rowSpan: 0,
          isSubTotal: true,
        })
      })

      // 4. 添加总计行
      const totalRow = this.dataSource.find((item) => item.goodsForm === '合计')
      if (totalRow) {
        const grandTotal = filteredData.reduce((sum, item) => sum + item.coinNum, 0)
        result.push({
          ...totalRow,
          coinNum: grandTotal,
          showGroupColumn: true,
          rowSpan: 1,
          isTotal: true,
        })
      }
      console.log()
      return result
    },
  },
  methods: {
    // 动态分组列渲染
    groupColumnRender(text, record) {
      return {
        children: record[this.groupColumn] ? record[this.groupColumn] : this.$t('合计'),
        attrs: {
          rowSpan: record.showGroupColumn ? record.rowSpan : 0,
        },
      }
    },
    initDictConfig() {
      this.customInit()
      initDictOptions('bis_order_goods.form').then((res) => {
        if (res.success) {
          this.formList = res.result
          this.formList.unshift({ value: '', title: this.$t('全部') })
        }
      })
      initDictOptions('query_condition.sum_method').then((res) => {
        if (res.success) {
          this.sumList = res.result
          this.sumList.unshift({ value: '', title: this.$t('全部') })
        }
      })
      initDictOptions('bis_device_info.type').then((res) => {
        if (res.success) {
          this.deviceinfoList = res.result
          this.deviceinfoList.unshift({ value: '', title: this.$t('全部') })
        }
      })
      initDictOptions('bis_shop,name,code').then((res) => {
        if (res.success) {
          this.shops = res.result
          this.shops.unshift({ value: '', title: this.$t('全部') })
        }
      })
    },
    customInit() {
      this.isHideData = true
      this.queryParam.dataType = 1
      if (this.queryParam.sumMethod == '1') {
        this.groupColumn = 'goodsForm'
      }
      if (this.queryParam.sumMethod == '2') {
        this.groupColumn = 'goodsKind'
      }
      if (this.queryParam.sumMethod == '3') {
        this.groupColumn = 'supplierName'
      }
      this.loadData(1)
    },
    searchQuery() {
      if (this.queryParam.sumMethod == '1') {
        this.groupColumn = 'goodsForm'
      }
      if (this.queryParam.sumMethod == '2') {
        this.groupColumn = 'goodsKind'
      }
      if (this.queryParam.sumMethod == '3') {
        this.groupColumn = 'supplierName'
      }
      this.selectedRowIndex = []
      this.$forceUpdate()
      this.loadData(1)
    },
    select() {
      let that = this
      let param = {}
      param.pageNo = 1
      param.pageSize = 9999
      param.column = 'sort'
      param.order = 'asc'
      getAction('/goods/bisGoodsKind/rootList', param).then((res) => {
        if (res.success) {
          that.allChildKind = []
          if (res.result.records.length > 0) {
            res.result.records.forEach((col) => {
              col.key = '' + col.id
              col.value = '' + col.id
              col.title = '' + col.name
              col.id = '' + col.id
              col.pid = '' + col.pid
              col.hasChild = '' + col.hasChild
              if (col.hasChild != '0') {
                that.getHasChild(col)
              }
            })
            that.treeData = that.getDataByResult(res.result.records)
            that.treeData.unshift({ key: '', id: '', value: '', title: this.$t('全部') })
          } else {
            that.treeData = []
          }
        } else {
          that.$alert(res.message, this.$t('提示'), {
            confirmButtonText: this.$t('确定'),
            callback: (action) => {},
          })
        }
      })
    },
    getHasChild(record) {
      let that = this
      let query = {}
      query.pageNo = 1
      query.pageSize = 9999
      query.pid = record.id
      getAction('/goods/bisGoodsKind/rootList', query).then((res) => {
        if (res.success) {
          if (res.result.records.length > 0) {
            res.result.records.forEach((col) => {
              col.key = '' + col.id
              col.value = '' + col.id
              col.title = '' + col.name
              col.pid = '' + col.pid
              col.id = '' + col.id
              col.hasChild = '' + col.hasChild
              if (col.hasChild != '0') {
                that.getHasChild(col)
              }
            })
            record.children = that.getDataByResult(res.result.records)
            that.treeData = [...that.treeData]
          }
        } else {
          that.$message.warning(res.message)
        }
      })
    },
    getDataByResult(result) {
      let that = this
      return result.map((item) => {
        if (item.hasChild == 0 && item.key != '0') {
          that.allChildKind.push(item.key)
        }
        return item
      })
    },
    searchReset() {
      let that = this
      that.queryParam = {
        bTime: moment().format('YYYY-MM-DD 00:00:00'),
        eTime: moment().format('YYYY-MM-DD 23:59:59'),
        goodsForm: '',
        goodsKind: '',
        orderType: '',
        deviceType: '',
        shopCode: '',
        sumMethod: '1',
      }
      that.selectedRowIndex = []
      that.customInit()
    },
    customRow(r, i) {
      return {
        on: {
          click: () => {
            let x = this.selectedRowIndex.findIndex(r=>{return r=='a'+this.ipagination.current+''+i})
            if( x == -1 ){
              this.selectedRowIndex.push('a'+this.ipagination.current+''+i)
            }else{
              this.selectedRowIndex.splice(x, 1)
            }
          }
        },
        style: {
          whiteSpace: 'break-spaces',
          wordBreak: 'break-word',
          overflowWrap: 'break-word',
          backgroundColor: this.selectedRowIndex.findIndex(r=>{return r=='a'+this.ipagination.current+''+i}) > -1 ? '#FFECE6' : '',
          fontWeight: r.goodsForm == this.$t('合计') || r.goodsName == this.$t('小计') ? 700 : 400,
        },
      }
    },
    handleDateClick(evt) {
      if (evt.key == '1') {
        this.queryParam.bTime = moment().format('YYYY-MM-DD 00:00:00')
        this.queryParam.eTime = moment().format('YYYY-MM-DD 23:59:59')
      }
      if (evt.key == '2') {
        this.queryParam.bTime = moment().subtract(2, 'day').format('YYYY-MM-DD 00:00:00')
        this.queryParam.eTime = moment().format('YYYY-MM-DD 23:59:59')
      }
      if (evt.key == '3') {
        this.queryParam.bTime = moment().subtract(6, 'day').format('YYYY-MM-DD 00:00:00')
        this.queryParam.eTime = moment().format('YYYY-MM-DD 23:59:59')
      }
      if (evt.key == '4') {
        this.queryParam.bTime = moment().subtract(1, 'month').format('YYYY-MM-DD 00:00:00')
        this.queryParam.eTime = moment().format('YYYY-MM-DD 23:59:59')
      }
      if (evt.key == '5') {
        this.queryParam.bTime = moment().subtract(3, 'month').format('YYYY-MM-DD 00:00:00')
        this.queryParam.eTime = moment().format('YYYY-MM-DD 23:59:59')
      }
      if (evt.key == '6') {
        this.queryParam.bTime = moment().subtract(6, 'month').format('YYYY-MM-DD 00:00:00')
        this.queryParam.eTime = moment().format('YYYY-MM-DD 23:59:59')
      }
      if (evt.key == '7') {
        this.queryParam.bTime = moment().startOf('year').format('YYYY-MM-DD 00:00:00')
        this.queryParam.eTime = moment().format('YYYY-MM-DD 23:59:59')
      }
      this.searchQuery()
    },
  },
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
<style>
@media print {
  @page {
    size: auto;
    margin: auto 3mm;
  }
  .printable-table {
    height: auto !important;
  }
  .printable-table .ant-table-body {
    height: auto !important;
    overflow: visible !important;
    max-height: none !important;
  }
  .printable-table .ant-table-container {
    height: auto !important;
  }
}
</style>